package com.bbzn.device.client.dao.device;

import com.bbzn.device.client.dataobject.Device;
import java.util.Date;
import java.util.List;import java.util.Set;
import com.bbzn.device.client.dto.ct.data.TemplateDeviceDTO;import com.bbzn.device.client.dto.device.*;import org.apache.ibatis.annotations.Param;

public interface DeviceMapper {
    /**
     * delete by primary key
     *
     * @param id primaryKey
     * @return deleteCount
     */
    int deleteByPrimaryKey(Long id);

    /**
     * insert record to table
     *
     * @param record the record
     * @return insert count
     */
    int insert(Device record);

    int insertOrUpdate(Device record);

    int insertOrUpdateSelective(Device record);

    /**
     * insert record to table selective
     *
     * @param record the record
     * @return insert count
     */
    int insertSelective(Device record);

    /**
     * select by primary key
     *
     * @param id primary key
     * @return object by primary key
     */
    Device selectByPrimaryKey(Long id);

    /**
     * update record selective
     *
     * @param record the updated record
     * @return update count
     */
    int updateByPrimaryKeySelective(Device record);

    /**
     * update record
     *
     * @param record the updated record
     * @return update count
     */
    int updateByPrimaryKey(Device record);

    List<Device> findByAll(Device device);

    int updateBatch(List<Device> list);

    int updateBatchSelective(List<Device> list);

    int batchInsert(@Param("list") List<Device> list);

    List<String> findByAllImeis(@Param("userId") Long userId);

    TemplateDeviceDTO getInfoByImei(@Param("imei") String imei);

    int findCountByAll(DeviceDTO record);

    int findDevCategoryByDeviceCount(DeviceDTO record);

    int updateByImeiSelective(Device record);

    List<Device> findPageByAll(DeviceDTO record);

    List<DeviceInfoDTO> findIndexAll(DeviceDTO record);

    int getMonthOnlineCount(DeviceDTO record);

    List<Device> selectProcessBySelective(DeviceDTO record);

    /**
     * 查询推送的用户id列表
     *
     * @param record
     * @return
     */
    List<Long> getOperatorIdsBySelective(DeviceDTO record);

    /**
     * 根据imei list查询设备列表
     */
    List<Device> selectByimeis(@Param("imeis") Set<String> imeis);

    List<Device> selectByIds(@Param("ids") List<Long> ids);

    RateDTO getRateInfoByImei(@Param("imei") String imei);

    TempDTO getTempInfoByImei(@Param("imei") String imei);

    PressureDTO getPressureInfoByImei(@Param("imei") String imei);

    BloodOxyDTO getBloodOxyInfoByImei(@Param("imei") String imei);

    VoltageDTO getVoltageInfoByImei(@Param("imei") String imei);

    HarmfulGasDTO getHarmfulGasInfoByImei(@Param("imei") String imei);

    OutTemperatureDTO getTemperatureByImei(@Param("imei") String imei);

    ElevationDTO getElevationByImei(@Param("imei") String imei);

    SlotTypeDTO getSlotTypeByImei(@Param("imei") String imei);

    GreetingDTO getGreetingInfoByImei(@Param("imei") String imei);

    /**
     * 根据imei 查询sku
     */
    SkuDTO selectSkuByImei(@Param("imei") String imei);

    /**
     * 获取未绑定的设备 + 带imei模糊查询
     */
    List<String> getUnUsedImei(@Param("userIds") List<Long> userIds, @Param("imei") String imei, @Param("productId") Long productId);

    DeviceInfoDTO selectByImei(@Param("imei") String imei);

    Device selByImei(@Param("imei") String imei);

    String getTopicByImei(@Param("imei") String imei);

    DevicePopupDTO selDevicePopup(@Param("imei") String imei);

    List<Device> selectPageBySelective(DeviceDTO recordDTO);

    int selectCountBySelective(DeviceDTO recordDTO);

    List<DeviceCountDTO> selectFireDeviceCount(@Param("userIds") List<Long> userIds);

    List<FireIndexDTO> selectFireDevice(@Param("userIds") List<Long> userIds);
}